home *** CD-ROM | disk | FTP | other *** search
/ AppleScript - The Beta Release / AppleScript - The Beta Release.iso / Development Tools / Sample Applications / MenuScripter 1.0d4.1 / MenuScripter Source / MSGlobals.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-11-24  |  4.5 KB  |  207 lines  |  [TEXT/MPS ]

  1. /*
  2.     MSGlobals.h
  3.     
  4.     Version 1.0d4
  5.     
  6.     Copyright © Apple Computer UK Ltd. 1992
  7.     
  8.     All rights reserved.
  9.     
  10.     Produced by : UK Developer Technical Support
  11.     AppleLink   : UK.DTS
  12. */
  13.  
  14. #ifndef __MSGLOBALS__
  15. #define __MSGLOBALS__
  16.  
  17. #include <Types.h>
  18. #include <QuickDraw.h>
  19. #include <Menus.h>
  20. #include <Editions.h>
  21. #include <Printing.h>
  22.  
  23. #define  MenuScripterAppSig 'SVEd'
  24.  
  25. #define  WindowID     128
  26. #define  ErrorAlert   256
  27. #define  AdviseAlert  257
  28.  
  29. /*
  30.     Menu Resource IDs
  31. */
  32.   
  33. #define  appleID    128
  34. #define  fileID        129
  35. #define  editID        130
  36. #define  mfontID    131
  37. #define     sizeID        132
  38. #define  styleID    133
  39. #define  mscriptID    134
  40.   
  41. #define  kLastID    mscriptID
  42.  
  43. /*
  44.     Items in Apple Menu
  45. */
  46.   
  47. #define  aboutItem  1
  48.   
  49. /*
  50.     Items in File Menu
  51. */
  52.   
  53. #define  fmNew                  1
  54. #define  fmOpen              2
  55. #define  fmClose              4
  56. #define  fmSave              5
  57. #define  fmSaveAs              6
  58. #define  fmRevert              7
  59. #define  fmPageSetUp          9
  60. #define  fmPrint              10
  61. #define  fmQuit              12
  62.   
  63. /*
  64.     Items in Edit Menu
  65. */
  66. #define  undoCommand              1
  67. #define  cutCommand              3
  68. #define  copyCommand              4
  69. #define  pasteCommand              5
  70. #define  clearCommand              6
  71. #define  selectAllCommand          7
  72.   
  73. #define  cPublisher                9
  74. #define  cSubscriber               10
  75. #define  cOptions                  11
  76. #define  cBorders                  12
  77.  
  78. /*
  79.     Items in Style Menu
  80. */
  81.  
  82. #define  cPlain              1
  83. #define  cBold                  2
  84. #define  cItalic             3
  85. #define  cUnderline         4
  86. #define  cOutline             5
  87. #define  cShadow             6
  88. #define  cCondense              7
  89. #define  cExtend             8
  90.  
  91. /*
  92.     Items in Script Menu
  93. */
  94.  
  95. #define  cCompile             1
  96. #define  cExecute             2
  97.  
  98. /*
  99.     Entry of Menu in myMenus
  100. */
  101.  
  102. #define  appleM         0
  103. #define  fileM              1
  104. #define  editM              2
  105. #define  fontM              3
  106. #define  sizeM              4
  107. #define  styleM         5
  108. #define  scriptM         6
  109. #define  kLastMenu        scriptM
  110.  
  111. /*
  112.     Save Changes Dialog Items
  113. */
  114.   
  115. #define  aaSave              1
  116. #define  aaDiscard              2
  117. #define  aaCancel              3
  118.  
  119. #define  kOSEvent               app4Evt        /*event used by MultiFinder*/
  120. #define  kSuspendResumeMessage         1        /*high byte of suspend/resume event message*/
  121. #define  kResumeMask                 1        /*bit of message field for resume vs. suspend*/
  122. #define  kMouseMovedMessage          0xFA        /*high byte of mouse-moved event message*/
  123. #define  kNoEvents                     0        /*no events mask*/
  124.   
  125. /*
  126.     this is a section record to hold the information about 
  127.     the publishers and subscribers in this document
  128. */  
  129.  
  130. struct SectRec {
  131.     SectionHandle   fSectHandle;
  132.     short           fSectionID;
  133.     RgnHandle       fBorderRgn; /*handle to the outside border*/
  134.     Rect            fInnerBounds;
  135.     short           fStart;     /*fStart and fEnd are both specific to a*/
  136.     short           fEnd;       /*text handling application- start and end of text selection*/
  137.     struct SectRec  **fNextSection;
  138.     FSSpec          fFSSpec;
  139.     short           fCount;
  140.     Handle          fTextHandle;
  141.     Boolean         fChanged; /*has the section been changed*/
  142.     struct DocRec   *fDocument;
  143.  };                          
  144.  
  145. typedef struct SectRec SectRec;
  146. typedef SectRec *SectPtr, **SectHandle;
  147.  
  148. struct DocRec {
  149.   TEHandle         theText;
  150.   ControlHandle    vScrollBar;
  151.   ControlHandle    hScrollBar;
  152.   WindowPtr        theWindow;
  153.   Boolean          dirty;
  154.   short            refNum;
  155.   short            theFont;
  156.   short            theSize;
  157.   Style            theStyle;
  158.   Str255           theFileName;
  159.   SectHandle       firstSection; /*the first section in the list*/
  160.   SectHandle       lastSection;  /*the last section*/
  161.   short            numSections;
  162.   FSSpec           theFSSpec;
  163.   short            lastID;      /*the last sectionID*/
  164.   THPrint          thePrintSetup;
  165.   Rect             pageSize;    /*From thePrintSetUp^^.prInfo.rPage but 0 offset*/
  166.   Boolean             showBorders;
  167.   Boolean          everSaved;
  168.   Boolean          isScriptWindow;
  169.   short            scriptResID;
  170. };
  171.  
  172. typedef struct DocRec DocRec;
  173. typedef DocRec *DPtr;
  174.  
  175. struct HeaderRec {
  176.   Str255    theFont;
  177.   short        theSize;
  178.   Style     theStyle;
  179.   short     theLength;
  180.   short     numSections;
  181.   short     lastID;
  182. };
  183.  
  184. typedef struct HeaderRec HeaderRec;
  185. typedef HeaderRec *HPtr, **HHandle;
  186.  
  187. #ifndef __COMPGLOBALS__
  188. extern short      gWCount;
  189. extern short      gNewDocCount;
  190. extern MenuHandle myMenus[kLastMenu+1];
  191. extern short      gFontMItem;
  192. extern Boolean    gQuitting;
  193. extern Cursor     editCursor;
  194. extern Cursor     waitCursor;
  195. extern Boolean    gInBackground;
  196.   
  197.   /*now for the environment variables set up by Gestalt*/
  198.   
  199. extern Boolean    gGestaltAvailable;
  200. extern Boolean    gAppleEventsImplemented;
  201. extern Boolean    gAliasManagerImplemented;
  202. extern Boolean    gEditionManagerImplemented;
  203. extern Boolean    gOutlineFontsImplemented;
  204.  
  205. #endif
  206.  
  207. #endif